<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="first">
        <input type="text" v-model="second">
    </div>
        <script>
                var vm = new Vue({
                    el:"#app",
                    data:{
                        first:"",
                        second:""
                    },
                    methods:{
                        
                    },
                    watch:{
                        // 利用watch 能监听数据变化 做出对应处理
                        first:function(newVal,oldVal){
                            console.log(newVal+"----"+oldVal);
                        }

                    }
                }) 
            </script>
</body>
</html>